<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" lang="zh">
<head>
    <meta charset="utf-8">
    <title>角色-添加</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" th:href="@{/layuiadmin/layui/css/layui.css}" href="../../../layuiadmin/layui/css/layui.css"
          media="all">
    <link rel="stylesheet" th:href="@{/css/layui-form-extend.css}">
</head>
<body>
<div  style="padding: 50px;">
    <form id="lay-form" class="layui-form" lay-filter="lay-form" th:action="@{/system/role/edit/{roleId}(roleId=${role.id})}" th:method="post">
        <div class="layui-form-item">
            <div class="layui-inline">
                <label for="roleName" class="layui-form-label lay-required">角色名称：</label>
                <div class="layui-input-inline">
                    <input type="text" id="roleName" name="roleName" class="layui-input lay-required" lay-verify="required"
                           placeholder="请输入"
                           autocomplete="off" th:value="${role.roleName}">
                </div>
                <!--<div class="layui-form-mid layui-word-aux" >
                  <span style="color: red">*</span>
                </div>-->
                <div class="layui-inline">
                    <label for="sort" class="layui-form-label lay-required">排序：</label>
                    <div class="layui-input-inline">
                        <input type="text" id="sort" name="sort" class="layui-input" lay-verify="required" th:value="${role.getSort()}">
                    </div>
                </div>
            </div>
        </div>

        <div class="layui-form-item">
            <label for="roleDesc" class="layui-form-label">描述：</label>
            <div class="layui-input-block">
                <textarea id="roleDesc" name="roleDesc" class="layui-textarea" th:text="${role.roleDesc}"></textarea>
            </div>

        </div>

        <div class="layui-form-item">
            <label for="authorityIdArray" class="layui-form-label">权限：</label>
            <div class="layui-input-block">
                <input type="checkbox" id="authorityIdArray" name="authorityIdArray"
                       th:each="auth:${authorities}"
                       th:value="${auth.id}"
                       th:title="${auth.authorityName}"
                       th:attr="checked=${ role.hasAuthorityIds == null ? false :  role.hasAuthorityIds.contains(auth.id)}">
            </div>
        </div>

        <div class="layui-form-item layui-hide">
            <input type="button" lay-submit lay-filter="lay-submit" id="lay-submit" value="确认">
        </div>

        <div th:class="divHdn" class="layui-hide">
            <input type="hidden" name="roleId" th:value="${role.id}"  >
        </div>
    </form>
</div>

<script th:src="@{/layuiadmin/layui/layui.js}" src="../../../layuiadmin/layui/layui.js"></script>
<script th:src="@{/js/jquery.min.js}"></script>
<script th:src="@{/js/jquery.form.js}"></script>

<script>
    layui.config({
        base: '../../../layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'form', 'upload'], function () {

    })
</script>
</body>
</html>